<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Object</title>
    <!--引入Vue-->
    <script type="text/javascript" src="../js/vue.js"></script>
</head>
<body>
<div class="root">
    <h1>欢迎来到{{name}}峡谷</h1><br>
    <!--
        prevent：阻止默认事件
        stop：阻止事件冒泡
        once：事件只触发一次
    -->
    <a href="https://www.baidu.com" @click.prevent="showInfo">阻止默认事件</a>
</div>
</body>

<script type="text/javascript">
    const vm = new Vue({
        el:'.root',
        data:{
            name:'召唤师'
        },
        methods:{
            showInfo(e){
                // e.preventDefault()
                alert("全军出击!!!")
            },
        }
    })
</script>
</html>
